<%-- 
    Document   : review
    Created on : May 4, 2011, 4:40:28 PM
    Author     : alexnewski
--%>

<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Collections"%>
<%@page import="com.movie.Cinema"%>
<%@page import="com.movie.Movie"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@include file="headerv.html"%>

<jsp:useBean id="DaoCinema" class="com.assg2.dao.DaoCinema" />
<jsp:useBean id="Cinema" class="com.movie.Cinema" />

<% Movie movie = (Movie) request.getAttribute("movie");
    List<Cinema> listcinemas = (List<Cinema>) request.getAttribute("listcinemas");%>

<h3><%=movie.getTitle()%></h3>

<%

    SimpleDateFormat format = new SimpleDateFormat("MM-dd-yyyy");

    out.println("<form method='POST' name='bookdate' action='dispatcher?operation=book&movieid=" + Integer.toString(movie.getIdmovie()) + "' onSubmit='return valFormBookDate()'>");
    out.println("<p><input type='text' size='12' id='calendarField' name='calendarField' /></p>");
    out.println("<p><select name='cinemaid' width='25px'>");
    for (Cinema cinema1 : listcinemas) {
        out.println("<option value='" + Integer.toString(cinema1.getIdcinema()) + "'>" + cinema1.getLocation() + "</option>");
    }
    out.println("</select></p>");
    out.println("<p><input type='submit' value='Accept' class='button'/></p>");
    out.println("</form>");

%>

<%@include file="footer.html"%>